import 'package:floor/floor.dart';

import '../../utils/local_datetime.dart';

class LocalDateTimeConverter extends TypeConverter<LocalDateTime, String> {
  @override
  LocalDateTime decode(String databaseValue) {
    return LocalDateTime.ofString(databaseValue);
  }

  @override
  String encode(LocalDateTime value) {
    return value.date.toIso8601String();
  }
}